﻿using AutoMapper;
using Eqwww.Domain.Models.Identity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Eqwww.Web.Areas.SystemManage.Models.Role
{
    public class RoleProfile : Profile
    {
        public RoleProfile()
        {
            CreateMap<RoleModel, IndexViewModel>()
                .ForMember(d => d.CreateUserName, opt => opt.MapFrom(s => s.CreateUser.RealName));
            CreateMap<RoleModel, CreateViewModel>()
                .ReverseMap();
            CreateMap<RoleModel, EditViewModel>();
            CreateMap<EditViewModel, RoleModel>();
        }
    }
}
